package com.limm.controller;

import com.limm.cloud01.entity.Dept;
import com.limm.service.FeignDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class FeignConsumerController {


    @Autowired
    private FeignDeptService service =null;

    @RequestMapping("/feign/dept/selectByID/{dept_no}")
    public Dept selectByID(@PathVariable Long dept_no) {
        return service.selectByID(dept_no);
    }

    @RequestMapping("/feign/dept/findAll")
    public List<Dept> findAll() {
        return service.findAll();
    }


}
